package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.WorkPlanDao;
import cn.topevery.garden.entity.dto.WorkPlanDTO;
import cn.topevery.garden.entity.po.WorkPlan;
import cn.topevery.garden.entity.po.WorkPlan;
import cn.topevery.garden.entity.query.WorkPlanQuery;
import cn.topevery.garden.entity.vo.WorkPlanVO;

import hw.topevery.framework.db.entity.DataPager;
import hw.topevery.framework.db.base.BaseEntityDao;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.UUID;

/**
 * 
 */
@Service
public class WorkPlanLogic extends BaseLogic<WorkPlan> {
    @Autowired
    WorkPlanDao workPlanDao;

    @Override
    public BaseEntityDao<WorkPlan, Integer> getDao() {
        return workPlanDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<WorkPlanVO> listPage(WorkPlanQuery query) {
        return workPlanDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        workPlanDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param workPlan 实体
     */
    public void saveOrUpdate(String userId, WorkPlan workPlan){
        workPlanDao.saveOrUpdate(userId,workPlan);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public WorkPlan getEntityByColumn(String key, String value) {
        return workPlanDao.getEntityByColumn(key, value);
    }
}
